# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=keycloak-config-cli
pkgver=5.12.0
pkgrel=0
pkgdesc="Configuration as Code for Keycloak"
url="https://github.com/adorsys/keycloak-config-cli"
arch="noarch !armhf !armv7 !riscv64 !x86"  # blocked by openjdk11+
license="Apache-2.0"
depends="java-jre-headless"
makedepends="maven openjdk11" # for build order resolution
source="https://github.com/adorsys/keycloak-config-cli/archive/v$pkgver/keycloak-config-cli-$pkgver.tar.gz
	keycloak-config-cli
	"
# !check: requires docker etc.
# net: downloads dependencies from Maven repositories
options="!check net"

# NOTE: Maven 3 dropped support for the M2_HOME variable.
export MAVEN_ARGS="--batch-mode -Duser.home=$srcdir/.home"

build() {
	mvn package -DskipTests=true
}

package() {
	install -D -m644 target/keycloak-config-cli.jar -t "$pkgdir"/usr/share/java/
	install -D -m755 "$srcdir"/keycloak-config-cli -t "$pkgdir"/usr/bin/
}

sha512sums="
9d1bb9974ebf86aee8f6da9774ac83206aa68d82b4eb9004897feee79a9cf14e1a3877aa223c5b2de118d6d5f125ae3a93f45cc3dd49a49dcf2eaa52cccaa9bf  keycloak-config-cli-5.12.0.tar.gz
c8bb931165294fe8cb605e315f4d76ea5a6a6b31a70b5f57a06941c658e0ef17d9f4f0540ddf2ebe768398a91dbc80654be73f4d924b99acc23a11be4154c523  keycloak-config-cli
"
